﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Business;
using Common;

namespace UI.Areas.Admin.Controllers
{
    public class OrderController : Controller
    {
        // GET: Admin/Order
        public ActionResult OrderList()
        {
            return View();
        }
        //获取订单列表
        public JsonResult Get_OrderList(int pageSize,int pageNumber)
        {
            //string querstring = "order=asc limit=25 offset=0";
            //int limit = Convert.ToInt32(Request.QueryString["limit"]);
            //int offset= Convert.ToInt32(Request.QueryString["limit"]);
            int recordcount = 0;//记录总条数
            int pagesize = pageSize;//一页数量
            int pageindex = pageNumber;//当前页码
            //分页类
            PageTable pageTable = new PageTable();
            pageTable.PageCount = pagesize;//每页显示行数
            pageTable.CurrPage = pageindex;
            pageTable.NotID = "ID";//默认不修改
            pageTable.Table = "pay_order";
            pageTable.Where = "1=1";
            pageTable.Order = "order by ID desc";

            List<PAY_ORDER> list = new PAY_ORDER().PagingQueryList(pageTable, out recordcount);

            return Json(new { total = recordcount, rows = list }, JsonRequestBehavior.AllowGet);
        }
    }
}